<template>
  <div class="view-account">
    <div class="p-12">
      <van-cell-group>
        <van-cell title="单元格" value="内容" :label="userInfo.nickname" />
      </van-cell-group>
    </div>

    <div class="pl-12 pr-12">
      <van-cell-group>
        <van-cell title="昵称" value="内容" />
        <van-cell title="性别" value="内容" />
        <van-cell title="生日" value="内容" />
        <van-cell title="手机" value="内容" />
        <van-cell title="邮箱" value="内容" />
        <van-cell title="签名" value="内容" />
      </van-cell-group>
    </div>

    <div class="p-12">
      <van-cell title="立即登录" @click="$router.push('/login')" is-link />
    </div>

    <div class="pl-12 pr-12">
      <van-button type="primary" block>注销登录</van-button>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import avatar from '@/assets/img/avatar.png'

export default {
  data() {
    return {
      avatar
    }
  },
  computed: {
    ...mapState({
      userInfo: state => state.user.userInfo,
      isValidLogin: state => state.user.isValidLogin
    })
  },
  mounted() {
    this.$store.dispatch('user/checkLoginState', {
      success: () => {}
    })
  }
}
</script>

<style lang="less" scoped>
.view-account {
  min-height: 100vh;
  background: #f5f5f5;
}
</style>
